/**
 * 
 */
package valverde.nacho.domain;

import java.util.Date;

/**
 * @author ignacio.canon@entelgy.com
 */
public class Contact {
    private Integer id;
    private String firstName;
    private String lastName;
    private String email;
    private String phoneNumber;
    private Date birthDate;

    @Override
    public boolean equals(Object obj) {
	try {
	    return id.equals(((Contact) obj).getId());
	}
	catch (Exception exc) {
	    return false;
	}
    }

    /**
     * getter para el campo id
     * 
     * @return id
     */
    public final Integer getId() {
	return id;
    }

    /**
     * @param id
     *            establece el valor de id
     */
    public final void setId(Integer id) {
	this.id = id;
    }

    /**
     * getter para el campo firstName
     * 
     * @return firstName
     */
    public final String getFirstName() {
	return firstName;
    }

    /**
     * @param firstName
     *            establece el valor de firstName
     */
    public final void setFirstName(String firstName) {
	this.firstName = firstName;
    }

    /**
     * getter para el campo lastName
     * 
     * @return lastName
     */
    public final String getLastName() {
	return lastName;
    }

    /**
     * @param lastName
     *            establece el valor de lastName
     */
    public final void setLastName(String lastName) {
	this.lastName = lastName;
    }

    /**
     * getter para el campo email
     * 
     * @return email
     */
    public final String getEmail() {
	return email;
    }

    /**
     * @param email
     *            establece el valor de email
     */
    public final void setEmail(String email) {
	this.email = email;
    }

    /**
     * getter para el campo phoneNumber
     * 
     * @return phoneNumber
     */
    public final String getPhoneNumber() {
	return phoneNumber;
    }

    /**
     * @param phoneNumber
     *            establece el valor de phoneNumber
     */
    public final void setPhoneNumber(String phoneNumber) {
	this.phoneNumber = phoneNumber;
    }

    /**
     * getter para el campo birthDate
     * 
     * @return birthDate
     */
    public final Date getBirthDate() {
	return birthDate;
    }

    /**
     * @param birthDate
     *            establece el valor de birthDate
     */
    public final void setBirthDate(Date birthDate) {
	this.birthDate = birthDate;
    }

    @Override
    public int hashCode() {
	return 31 + ((id == null) ? 0 : id.hashCode());
    }

    @Override
    public String toString() {
	return String.format("%s %s", firstName, lastName);
    }
}
